import java.util.Scanner;

public class Decimal {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        String number = s.next();

        double sum = 0.0;
        for (int i = 0; i < number.length(); i++) {
            int num = Integer.parseInt(String.valueOf(number.charAt(i)));
            if (num != 0) {
                sum = sum + Math.pow(2, number.length() - 1 - i) * num;
            }
        }
        System.out.println("你输入的二进制数对应的十进制数为：" + sum);
        s.close();

    }
}